﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RegisterForm.aspx.cs" MasterPageFile="~/Site.master"  Inherits="RegisterForm" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Create a New Account
    </h2>
    <p>
        Use the form below to create a new account.
    </p>
    <p>
        Passwords are required to be a minimum of
                        characters in length.
    </p>
    <p runat="server" id="emailSentMessage" visible="false">
    <strong style="color:Green">A confirmation mail was sent to your email.</strong>
    </p>

    <span class="failureNotification">
    <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
    </span>
    <asp:CustomValidator 
                ID="SendMailFailedValidator" 
                runat="server" 
                CssClass="failureNotification" 
                ErrorMessage="Sending confirmation mail failed." 
                ToolTip="Sending confirmation mail failed."></asp:CustomValidator>
    <asp:ValidationSummary ID="RegisterUserValidationSummary" runat="server" CssClass="failureNotification"
                        ValidationGroup="RegisterUserValidationGroup" />
    <div class="style1">
        <fieldset class="register">
            <legend>Account Information</legend>
            <p>
            <asp:CustomValidator 
                ID="UserExistsValidator" 
                runat="server" 
                CssClass="failureNotification" 
                ErrorMessage="The User is already exists." 
                ToolTip="The User is already exists."
                ControlToValidate="Email"></asp:CustomValidator>
                <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label>
                <asp:TextBox ID="Email" runat="server" CssClass="textEntry"></asp:TextBox>
                <asp:RequiredFieldValidator 
                ID="EmailRequired" 
                runat="server" 
                ControlToValidate="Email"
                CssClass="failureNotification" 
                ErrorMessage="E-mail is required." 
                ToolTip="E-mail is required."
                ValidationGroup="RegisterUserValidationGroup" 
                SetFocusOnError="True">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="EmailValid" runat="server" 
                    ControlToValidate="Email" CssClass="failureNotification" 
                    ErrorMessage="E-mail is not valid." ToolTip="E-mail is not valid." 
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                    ValidationGroup="RegisterUserValidationGroup"></asp:RegularExpressionValidator>
            </p>
            <p>
                <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                <asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" 
                                    TextMode="Password"></asp:TextBox>
                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                    CssClass="failureNotification" 
                    ErrorMessage="Password is required." ToolTip="Password is required."
                                    ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
            </p>
            <p>
                <asp:Label ID="ConfirmPasswordLabel" runat="server" 
                                    AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label>
                <asp:TextBox ID="ConfirmPassword" runat="server" CssClass="passwordEntry" 
                                    TextMode="Password"></asp:TextBox>
                <asp:RequiredFieldValidator ControlToValidate="ConfirmPassword" CssClass="failureNotification"
                                    Display="Dynamic" 
                    ErrorMessage="Confirm Password is required." ID="ConfirmPasswordRequired"
                                    runat="server" ToolTip="Confirm Password is required." 
                                    ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                                    ControlToValidate="ConfirmPassword" 
                    CssClass="failureNotification" Display="Dynamic"
                                    ErrorMessage="The Password and Confirmation Password must match." 
                                    ValidationGroup="RegisterUserValidationGroup">*</asp:CompareValidator>
            </p>
        </fieldset>
        <p class="submitButton">
            <asp:Button ID="CreateUserButton" runat="server" CommandName="MoveNext" Text="Create User"
                                ValidationGroup="RegisterUserValidationGroup" 
                onclick="CreateUserButton_Click" />
        </p>
    </div>
</asp:Content>